//package src;
import java.awt.*;

public class DrawOval extends Order 
{

	private Point first;
	
  	public void mousePressExe(Point p, Drawing Layer)
  	{
    		first = p;
    		ShapeOval o = new ShapeOval(p.x, p.y, 0, 0, Layer.getColor());
    		Layer.add(o); 
  	}

	
  	public void mouseDragShiftExe(Point p, Drawing Layer)
  	{
    		ShapeOval o = new ShapeOval(Math.min(p.x, first.x), Math.min(p.y, first.y),
                      Math.abs(p.x - first.x), Math.abs(p.x - first.x), Layer.getColor());
		                      
    		Layer.remainEndshape(o);
  	}
  	
  	public void mouseDragExe(Point p, Drawing Layer, GraphicsObject graphics)
  	{
    		ShapeOval o = new ShapeOval(Math.min(p.x, first.x), Math.min(p.y, first.y),
                      Math.abs(p.x - first.x), Math.abs(p.y - first.y), Layer.getColor());
                   
    		Layer.remainEndshape(o);
  	}
}
